﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_Last_Knights.Helper
{
    public class GameEntityDictionary
    {
        static Dictionary<string, object> _dictionary = new Dictionary<string, object>();

        public static bool Add(string key, object value)
        {
            if (_dictionary.ContainsKey(key))
                return false;
            _dictionary.Add(key, value);
            return true;
        }

        public static bool Remove(string key)
        {
            if (_dictionary.ContainsKey(key))
            {
                _dictionary.Remove(key);
                return true;
            }
            return false;
        }

        public static bool IsContainKey(string key)
        {
            if (_dictionary.ContainsKey(key))
                return true;
            return false;
        }

        public static void Add(Dictionary<string, object> value)
        {
            foreach (var o in value)
            {
                Add(o.Key, o.Value);
            }
        }

        public static void Remove(Dictionary<string, object> value)
        {
            foreach (var o in value)
            {
                Remove(o.Key);
            }
        }

        public static object GetValue(string key)
        {
            if (_dictionary.ContainsKey(key))
                return _dictionary[key];
            return null;
        }
    }
}
